function fictionListOnDeleteButtonClick(buttonHandle) {
    Swal.fire({
        title: '警告',
        text: "删除的操作不可恢复，请确认！",
        icon: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: '是的，我永远不再需要！'
    }).then((result) => {
        if (result.value) {
            var trHandle = buttonHandle.parentElement.parentElement;

            var cid = trHandle.getAttribute('cid');

            $.ajax(
                {
                    type: 'post',
                    async: true,
                    data: {
                        'cid': cid,
                    },
                    url: document.location.origin + '/api/deletefiction',
                    dataType:'text',
                    success: function(data) {
                        var json = JSON.parse(data);

                        if (json.result == 200) {
                            trHandle.parentElement.removeChild(trHandle);

                            Swal.fire(
                                '删除!',
                                '已经删除',
                                'success'
                            )
                        }
                        else {
                            handle.css('display', 'block');
                            handle.text(data);
                        }
                    },
                    error: function () {
                        console.log("Ajax 发生错误！");
                    }
                }
            );
        }
    });
}

function fictionListOnUpdateButtonClick(buttonHandle) {
    var trHandle = buttonHandle.parentElement.parentElement;
    var cid = trHandle.getAttribute('cid');
    window.location.href = document.location.origin + "/fictionupdate?id=" + URLencode(cid);
}

function fictionListOnAddButtonClick() {
    var uri = document.location.origin + "/fictionadd";
    window.location.href = uri;
}

function fictionListOnAudioButtonClick(buttonHandle) {
    var trHandle = buttonHandle.parentElement.parentElement;
    var cid = trHandle.getAttribute('cid');

    var url = "id=" + URLencode(cid);
    window.location.href = "/audioedit?" + url;
}

function fictionListOnMovieButtonClick(buttonHandle) {

}

function fictionListOnCartoonButtonClick(buttonHandle) {

}
